c# object to json string

41

object to json c# -

using Newtonsoft.Json;

var jsonString = JsonConvert.SerializeObject(obj);

how to convert object in string JSON c# -

var json = new JavaScriptSerializer().Serialize(obj);

string json to class c# -

var result = JsonConvert.DeserializeObject<YourClass>(jsonstring);

Comments

Submit
0 Comments